﻿using Ducu.GLB.Global;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ducu.BLL.Entity
{
    public class Chat : BaseEntity
    {
        public virtual User From { get; set; }
        public virtual User To { get; set; }
        public virtual string Content { get; set; }

        public virtual Message GetMessage()
        {
            return new Message
            {
                SendFrom = From,
                SendTo = To,
                Content = MessageTemplate.Make(
                    From.Profile.DisplayName, From.Id.ToString(),
                    To.Profile.DisplayName, To.Id.ToString(),
                    Content),
                Reply = ReplyTemplate.OnUser(From.Id.ToString())
            };
        }
    }
}
